setwd(paste0(getwd(), "/behavior")) # set working subdir

behav.exps <- c(
  list.files(pattern = ".csv")[2],
  list.files(pattern = ".csv")[3],
  list.files(pattern = ".csv")[1]
)

behav.data <- behav.exps %>%
  map_df(~ read_csv(.)) %>%
  mutate(
    experiment = factor(
      c(
        rep("pilot1", 15 * 6),
        rep("pilot2", 16 * 12),
        rep("exp1", 31 * 12)
      ),
      levels = c("pilot1", "pilot2", "exp1")
    ),
    participant = as.factor(subjects),
    orientation = as.factor(
      case_when(
        grepl("up", cond) ~ "upright",
        grepl("dw", cond) ~ "inverted"
      )
    ),
    variability = as.factor(
      case_when(
        grepl("_m", cond) ~ "high",
        grepl("_f", cond) ~ "low",
        TRUE ~ "NA"
      )
    ),
    regularity = as.factor(
      case_when(
        grepl("A_", cond) | grepl("a_", cond) ~ "angry",
        grepl("N_", cond) | grepl("n_", cond) ~ "neutral",
        grepl("I_", cond) | grepl("i_", cond) ~ "irregular"
      )
    )
  ) %>%
  unite(condition, c(orientation, regularity, variability), sep = "_", remove = FALSE) %>%
  dplyr::select(experiment, participant, orientation, regularity, variability, condition, RTs = "rt")

# IMPUTATION MISSING DATA
length(which(is.na(behav.data$RTs))) # number of missing values to impute

# imputation (in different data frame)
temp.behav.data <- mice(behav.data,
  m = 1, # number of multiple imputations
  maxit = 1000, # maximum number of iterations
  meth = "pmm", # imputation method: Predictive mean matching (see ?mice)
  seed = seed.smorfia # RNG seed for reproducibility
)

# graphical comparison of observed (in blue) and imputed data (in pink)
# if the imputation was successful, the two distributions should overlap
densityplot(temp.behav.data)
# despite the low number of data points, the imputation was reasonably close to the observed data

# insert imputed values in original data frame
behav.data <- complete(temp.behav.data)

# verify that imputation occurred
length(which(is.na(behav.data$RTs)))

write_csv(behav.data, # save imputed data
  path = "RTs_imputed.csv"
)

rm(behav.exps, temp.behav.data) # remove unused variables

Behavioral data were collected in 2 pilots and 1 main experiment, whereas in the last experiment participants were asked to passively view the stream of faces.

experiment orientation regularity variability N RTs CI.95.low CI.95.high
pilot1 upright angry NA 15 519.4 514.9 523.8
pilot1 upright neutral NA 15 520.5 513.7 527.2
pilot1 upright irregular NA 15 513.9 505.8 522.0
pilot1 inverted angry NA 15 518.6 510.6 526.7
pilot1 inverted neutral NA 15 519.7 511.9 527.5
pilot1 inverted irregular NA 15 524.8 516.8 532.8
pilot2 upright angry low 16 513.9 496.5 531.3
pilot2 upright angry high 16 520.0 487.0 552.9
pilot2 upright neutral low 16 489.1 460.5 517.7
pilot2 upright neutral high 16 531.7 501.9 561.5
pilot2 upright irregular low 16 488.2 451.2 525.2
pilot2 upright irregular high 16 545.0 476.4 613.6
pilot2 inverted angry low 16 526.1 501.5 550.8
pilot2 inverted angry high 16 507.1 476.3 537.9
pilot2 inverted neutral low 16 491.3 458.3 524.4
pilot2 inverted neutral high 16 511.0 476.4 545.5
pilot2 inverted irregular low 16 560.0 511.9 608.1
pilot2 inverted irregular high 16 550.4 496.1 604.7
exp1 upright angry low 31 516.0 476.5 555.4
exp1 upright angry high 31 502.2 461.3 543.2
exp1 upright neutral low 31 509.4 465.4 553.5
exp1 upright neutral high 31 509.0 477.2 540.8
exp1 upright irregular low 31 481.0 447.2 514.8
exp1 upright irregular high 31 560.0 516.6 603.5
exp1 inverted angry low 31 486.0 443.3 528.8
exp1 inverted angry high 31 523.0 477.1 569.0
exp1 inverted neutral low 31 549.0 509.5 588.6
exp1 inverted neutral high 31 512.1 474.9 549.2
exp1 inverted irregular low 31 536.6 492.3 581.0
exp1 inverted irregular high 31 549.3 504.7 593.9
behav.data <- behav.data %>%
  unite("cond4plot", c(orientation, regularity), sep = " ", remove = FALSE) %>%
  mutate(cond4plot = factor(cond4plot,
    levels = c(
      "upright angry", "upright neutral", "upright irregular",
      "inverted angry", "inverted neutral", "inverted irregular"
    )
  ))

# pilot1 does not have the column "variability", which messes up all the other plots...
# that's why they are created separately instead of calling facet_wrap(~ experiment, scales = "free")

# pilot1
behav.plot.pilot1 <-
  behav.data %>%
  filter(experiment == "pilot1") %>%
  ggplot(aes(
    x = cond4plot,
    y = RTs,
    color = cond4plot,
    fill = cond4plot
  )) +
  geom_pirate(
    bars = FALSE,
    cis = TRUE,
    lines = TRUE, lines_params = list(color = "black"),
    points = TRUE, points_params = list(shape = 16, color = "black", size = 5, alpha = .2),
    violins = TRUE, violins_params = list(size = 1),
    show.legend = FALSE
  ) +
  scale_fill_viridis_d() +
  scale_color_viridis_d() +
  scale_y_continuous(
    limits = c(0, 800),
    breaks = seq(0, 800, 100)
  ) +
  coord_cartesian(ylim = c(200, 800)) +
  geom_hline(
    yintercept = seq(0, 800, 100),
    linetype = "dotted",
    colour = "#999999",
    size = .8,
    alpha = .5
  ) +
  labs(
    x = "",
    y = "ms"
  ) +
  ggtitle("pilot 1") +
  theme_EmoSSR +
  theme(legend.position = "right")

# pilot2
behav.plot.pilot2 <-
  behav.data %>%
  filter(experiment == "pilot2") %>%
  ggplot(aes(
    x = cond4plot,
    y = RTs,
    color = variability,
    fill = variability
  )) +
  geom_pirate(
    bars = FALSE,
    cis = TRUE,
    lines = TRUE, lines_params = list(color = "black"),
    points = TRUE, points_params = list(shape = 16, size = 5, alpha = .2),
    violins = TRUE, violins_params = list(size = 1),
    show.legend = TRUE
  ) +
  scale_fill_viridis_d(option = "cividis") +
  scale_color_viridis_d(option = "cividis") +
  scale_y_continuous(
    limits = c(0, 800),
    breaks = seq(0, 800, 100)
  ) +
  coord_cartesian(ylim = c(200, 800)) +
  geom_hline(
    yintercept = seq(0, 800, 100),
    linetype = "dotted",
    colour = "#999999",
    size = .8,
    alpha = .5
  ) +
  labs(
    x = "",
    y = "ms"
  ) +
  ggtitle("pilot 2") +
  theme_EmoSSR +
  theme(legend.position = "right")

# exp1
behav.plot.exp1 <-
  behav.data %>%
  filter(experiment == "exp1") %>%
  ggplot(aes(
    x = cond4plot,
    y = RTs,
    color = variability,
    fill = variability
  )) +
  geom_pirate(
    bars = FALSE,
    cis = TRUE,
    lines = TRUE, lines_params = list(color = "black"),
    points = TRUE, points_params = list(shape = 16, size = 5, alpha = .2),
    violins = TRUE, violins_params = list(size = 1),
    show.legend = TRUE
  ) +
  scale_fill_viridis_d(option = "cividis") +
  scale_color_viridis_d(option = "cividis") +
  scale_y_continuous(
    limits = c(0, 800),
    breaks = seq(0, 800, 100)
  ) +
  coord_cartesian(ylim = c(200, 800)) +
  geom_hline(
    yintercept = seq(0, 800, 100),
    linetype = "dotted",
    colour = "#999999",
    size = .8,
    alpha = .5
  ) +
  labs(
    x = "",
    y = "ms"
  ) +
  ggtitle("experiment 1") +
  theme_EmoSSR +
  theme(legend.position = "right")

plot_grid(behav.plot.pilot1, behav.plot.pilot2, behav.plot.exp1,
          ncol = 1)

For the statistical analyses, we fit Bayesian multilevel models using brms. The constant effect was condition. Intercepts and slopes were allowed to vary as a function of participant.

Pilot 1

  • flickering frequency: 15 Hz
  • regularity: 5 Hz
  • 9 face identities
  • task: detect dots on faces
Parameter Mean HDI95_Low HDI95_High Estimated_Sample_Size MonteCarlo_StdErr
inverted_angry 437.1 420.4 452.2 7273 0.09
inverted_irregular 443.3 427.5 459.4 8041 0.09
inverted_neutral 438.1 422.9 453.1 8575 0.08
upright_angry 437.9 426.4 449.4 8374 0.06
upright_irregular 432.3 418.9 445.4 10495 0.07
upright_neutral 439.0 424.1 453.0 8191 0.08

pilot1.posterior.test <- pilot1.model %>%
  spread_draws(`b_.*`, regex = TRUE) %>%
  dplyr::select(
    "upright angry" = "b_conditionupright_angry",
    "upright neutral" = "b_conditionupright_neutral",
    "upright irregular" = "b_conditionupright_irregular",
    "inverted angry" = "b_conditioninverted_angry",
    "inverted neutral" = "b_conditioninverted_neutral",
    "inverted irregular" = "b_conditioninverted_irregular"
  ) %>%
  mutate(
    ### orientation (upright minus inverted)
    # angry
    diff.angry.uprightVSinverted = `upright angry` - `inverted angry`,
    # neutral
    diff.neutral.uprightVSinverted = `upright neutral` - `inverted neutral`,
    # irregular
    diff.irregular.uprightVSinverted = `upright irregular` - `inverted irregular`,
    ### regularity
    ## upright
    # angry minus neutral
    diff.upright.angryVSneutral = `upright angry` - `upright neutral`,
    # angry minus irregular
    diff.upright.angryVSirregular = `upright angry` - `upright irregular`,
    # neutral minus irregular
    diff.upright.neutralVSirregular = `upright neutral` - `upright irregular`,
    ## inverted
    # angry minus neutral
    diff.inverted.angryVSneutral = `inverted angry` - `inverted neutral`,
    # angry minus irregular
    diff.inverted.angryVSirregular = `inverted angry` - `inverted irregular`,
    # neutral minus irregular
    diff.inverted.neutralVSirregular = `inverted neutral` - `inverted irregular`
  ) %>%
  gather(key = "condition", value = "RTs") %>%
  filter(condition == c("diff.angry.uprightVSinverted",
                        "diff.neutral.uprightVSinverted",
                        "diff.irregular.uprightVSinverted",
                        "diff.upright.angryVSneutral",
                        "diff.upright.angryVSirregular",
                        "diff.upright.neutralVSirregular",
                        "diff.inverted.angryVSneutral",
                        "diff.inverted.angryVSirregular",
                        "diff.inverted.neutralVSirregular")) %>%
  droplevels() %>%
  mutate(condition = factor(condition,
                            levels = c("diff.angry.uprightVSinverted",
                                       "diff.neutral.uprightVSinverted",
                                       "diff.irregular.uprightVSinverted",
                                       "diff.upright.angryVSneutral",
                                       "diff.upright.angryVSirregular",
                                       "diff.upright.neutralVSirregular",
                                       "diff.inverted.angryVSneutral",
                                       "diff.inverted.angryVSirregular",
                                       "diff.inverted.neutralVSirregular"))
  )

# summary
summary.pilot1.posterior.test <- pilot1.posterior.test %>%
  group_by(condition) %>%
  dplyr::summarize(
    mean = mean(RTs),
    hdi.95.low = hdi(RTs)[1],
    hdi.95.high = hdi(RTs)[2],
    evidence.ratio = ifelse(mean < 0, 
                            length(which(RTs < 0)) / length(which(RTs > 0)),
                            length(which(RTs > 0)) / length(which(RTs < 0))
    )
  ) %>%
  ungroup()

kable(summary.pilot1.posterior.test, digits = 2)
condition mean hdi.95.low hdi.95.high evidence.ratio
diff.angry.uprightVSinverted 0.48 -13.05 15.83 1.11
diff.neutral.uprightVSinverted 0.79 -16.08 17.58 1.17
diff.irregular.uprightVSinverted -11.13 -25.50 6.98 11.61
diff.upright.angryVSneutral -1.11 -12.50 10.74 1.38
diff.upright.angryVSirregular 5.59 -5.15 17.56 5.49
diff.upright.neutralVSirregular 6.76 -7.88 21.54 4.97
diff.inverted.angryVSneutral -0.59 -16.85 16.31 1.11
diff.inverted.angryVSirregular -6.34 -23.32 11.93 3.36
diff.inverted.neutralVSirregular -5.23 -17.23 6.12 4.61

Take-home message:

  • irregular: slightly slower RTs for inverted compared to upright faces


Pilot 2

  • flickering frequency: 15 Hz
  • regularity: 5 Hz
  • 2 face identities
  • task: detect dots on faces
Parameter Mean HDI95_Low HDI95_High Estimated_Sample_Size MonteCarlo_StdErr
10 upright_angry_low 547.2 520.6 575.0 12524 0.12
16 upright_neutral_low 522.4 492.5 552.5 12025 0.14
13 upright_irregular_low 521.6 490.4 554.1 12563 0.15
14 upright_irregular_low 521.6 490.4 554.1 12563 0.15
2 inverted_angry_low 559.5 531.6 587.3 13287 0.12
8 inverted_neutral_low 525.1 494.6 555.8 12763 0.14
5 inverted_irregular_low 592.8 549.1 637.3 13369 0.19
6 inverted_irregular_low 592.8 549.1 637.3 13369 0.19
9 upright_angry_high 553.2 525.0 580.7 12673 0.13
15 upright_neutral_high 564.9 536.2 594.1 13611 0.13
11 upright_irregular_high 577.6 510.7 642.1 12878 0.30
12 upright_irregular_high 577.6 510.7 642.1 12878 0.30
1 inverted_angry_high 540.5 510.4 570.6 13191 0.13
7 inverted_neutral_high 544.4 512.2 577.3 13380 0.14
3 inverted_irregular_high 583.2 528.8 634.3 13746 0.23
4 inverted_irregular_high 583.2 528.8 634.3 13746 0.23

pilot2.posterior.test <- pilot2.model %>%
  spread_draws(`b_.*`, regex = TRUE) %>%
  dplyr::select(
    "upright angry high" = "b_conditionupright_angry_high",
    "upright neutral high" = "b_conditionupright_neutral_high",
    "upright irregular high" = "b_conditionupright_irregular_high",
    "upright angry low" = "b_conditionupright_angry_low",
    "upright neutral low" = "b_conditionupright_neutral_low",
    "upright irregular low" = "b_conditionupright_irregular_low",
    "inverted angry high" = "b_conditioninverted_angry_high",
    "inverted neutral high" = "b_conditioninverted_neutral_high",
    "inverted irregular high" = "b_conditioninverted_irregular_high",
    "inverted angry low" = "b_conditioninverted_angry_low",
    "inverted neutral low" = "b_conditioninverted_neutral_low",
    "inverted irregular low" = "b_conditioninverted_irregular_low"
  ) %>%
  mutate(
    ### orientation
    # angry high
    diff.high.angry.uprightVSinverted = `upright angry high` - `inverted angry high`,
    # neutral high
    diff.high.neutral.uprightVSinverted = `upright neutral high` - `inverted neutral high`,
    # irregular high
    diff.high.irregular.uprightVSinverted = `upright irregular high` - `inverted irregular high`,
    # angry low
    diff.low.angry.uprightVSinverted = `upright angry low` - `inverted angry low`,
    # neutral high
    diff.low.neutral.uprightVSinverted = `upright neutral low` - `inverted neutral low`,
    # irregular high
    diff.low.irregular.uprightVSinverted = `upright irregular low` - `inverted irregular low`,
    ### regularity
    ## upright high
    # angry minus neutral
    diff.high.upright.angryVSneutral = `upright angry high` - `upright neutral high`,
    # angry minus irregular
    diff.high.upright.angryVSirregular = `upright angry high` - `upright irregular high`,
    # neutral minus irregular
    diff.high.upright.neutralVSirregular = `upright neutral high` - `upright irregular high`,
    ## upright low
    # angry minus neutral
    diff.low.upright.angryVSneutral = `upright angry low` - `upright neutral low`,
    # angry minus irregular
    diff.low.upright.angryVSirregular = `upright angry low` - `upright irregular low`,
    # neutral minus irregular
    diff.low.upright.neutralVSirregular = `upright neutral low` - `upright irregular low`,
    ## inverted high
    # angry minus neutral
    diff.high.inverted.angryVSneutral = `inverted angry high` - `inverted neutral high`,
    # angry minus irregular
    diff.high.inverted.angryVSirregular = `inverted angry high` - `inverted irregular high`,
    # neutral minus irregular
    diff.high.inverted.neutralVSirregular = `inverted neutral high` - `inverted irregular high`,
    ## inverted low
    # angry minus neutral
    diff.low.inverted.angryVSneutral = `inverted angry low` - `inverted neutral low`,
    # angry minus irregular
    diff.low.inverted.angryVSirregular = `inverted angry low` - `inverted irregular low`,
    # neutral minus irregular
    diff.low.inverted.neutralVSirregular = `inverted neutral low` - `inverted irregular low`,
    ### variability
    ## upright angry
    diff.upright.angry.highVSlow = `upright angry high` - `upright angry low`,
    ## upright neutral
    diff.upright.neutral.highVSlow = `upright neutral high` - `upright neutral low`,
    ## upright irregular
    diff.upright.irregular.highVSlow = `upright irregular high` - `upright irregular low`,
    ## inverted angry
    diff.inverted.angry.highVSlow = `inverted angry high` - `inverted angry low`,
    ## inverted neutral
    diff.inverted.neutral.highVSlow = `inverted neutral high` - `inverted neutral low`,
    ## inverted irregular
    diff.inverted.irregular.highVSlow = `inverted irregular high` - `inverted irregular low`
  ) %>%
  gather(key = "condition", value = "RTs") %>%
  filter(condition == c(
    "diff.high.angry.uprightVSinverted",
    "diff.high.neutral.uprightVSinverted",
    "diff.high.irregular.uprightVSinverted",
    "diff.low.angry.uprightVSinverted",
    "diff.low.neutral.uprightVSinverted",
    "diff.low.irregular.uprightVSinverted",
    "diff.high.upright.angryVSneutral",
    "diff.high.upright.angryVSirregular",
    "diff.high.upright.neutralVSirregular",
    "diff.low.upright.angryVSneutral",
    "diff.low.upright.angryVSirregular",
    "diff.low.upright.neutralVSirregular",
    "diff.high.inverted.angryVSneutral",
    "diff.high.inverted.angryVSirregular",
    "diff.high.inverted.neutralVSirregular",
    "diff.low.inverted.angryVSneutral",
    "diff.low.inverted.angryVSirregular",
    "diff.low.inverted.neutralVSirregular",
    "diff.upright.angry.highVSlow",
    "diff.upright.neutral.highVSlow",
    "diff.upright.irregular.highVSlow",
    "diff.inverted.angry.highVSlow",
    "diff.inverted.neutral.highVSlow",
    "diff.inverted.irregular.highVSlow"
  )) %>%
  droplevels() %>%
  mutate(condition = factor(condition,
    levels = c(
      "diff.high.angry.uprightVSinverted",
      "diff.high.neutral.uprightVSinverted",
      "diff.high.irregular.uprightVSinverted",
      "diff.low.angry.uprightVSinverted",
      "diff.low.neutral.uprightVSinverted",
      "diff.low.irregular.uprightVSinverted",
      "diff.high.upright.angryVSneutral",
      "diff.high.upright.angryVSirregular",
      "diff.high.upright.neutralVSirregular",
      "diff.low.upright.angryVSneutral",
      "diff.low.upright.angryVSirregular",
      "diff.low.upright.neutralVSirregular",
      "diff.high.inverted.angryVSneutral",
      "diff.high.inverted.angryVSirregular",
      "diff.high.inverted.neutralVSirregular",
      "diff.low.inverted.angryVSneutral",
      "diff.low.inverted.angryVSirregular",
      "diff.low.inverted.neutralVSirregular",
      "diff.upright.angry.highVSlow",
      "diff.upright.neutral.highVSlow",
      "diff.upright.irregular.highVSlow",
      "diff.inverted.angry.highVSlow",
      "diff.inverted.neutral.highVSlow",
      "diff.inverted.irregular.highVSlow"
    )
  ))

# summary
summary.pilot2.posterior.test <- pilot2.posterior.test %>%
  group_by(condition) %>%
  dplyr::summarize(
    mean = mean(RTs),
    hdi.95.low = hdi(RTs)[1],
    hdi.95.high = hdi(RTs)[2],
    evidence.ratio = ifelse(mean < 0, 
                            length(which(RTs < 0)) / length(which(RTs > 0)),
                            length(which(RTs > 0)) / length(which(RTs < 0))
    )
  ) %>%
  ungroup()

kable(summary.pilot2.posterior.test, digits = 2)
condition mean hdi.95.low hdi.95.high evidence.ratio
diff.high.angry.uprightVSinverted 14.26 -26.02 58.01 2.81
diff.high.neutral.uprightVSinverted 20.78 -21.85 59.68 5.54
diff.high.irregular.uprightVSinverted -3.52 -71.89 93.20 1.18
diff.low.angry.uprightVSinverted -13.03 -47.47 26.28 3.17
diff.low.neutral.uprightVSinverted -3.75 -45.00 34.61 1.33
diff.low.irregular.uprightVSinverted -71.78 -123.64 -14.71 132.20
diff.high.upright.angryVSneutral -11.59 -53.36 29.25 2.75
diff.high.upright.angryVSirregular -24.49 -88.59 56.67 3.02
diff.high.upright.neutralVSirregular -15.05 -93.75 48.13 2.12
diff.low.upright.angryVSneutral 25.18 -12.06 67.21 9.42
diff.low.upright.angryVSirregular 25.67 -16.16 62.58 7.54
diff.low.upright.neutralVSirregular 0.97 -40.96 46.95 1.11
diff.high.inverted.angryVSneutral -3.69 -44.22 35.52 1.25
diff.high.inverted.angryVSirregular -41.42 -104.62 21.02 9.92
diff.high.inverted.neutralVSirregular -40.00 -109.86 17.40 8.81
diff.low.inverted.angryVSneutral 32.84 -10.58 70.07 18.06
diff.low.inverted.angryVSirregular -32.81 -84.74 20.69 7.13
diff.low.inverted.neutralVSirregular -68.07 -128.91 -24.05 94.29
diff.upright.angry.highVSlow 4.77 -37.43 42.06 1.59
diff.upright.neutral.highVSlow 42.07 4.62 82.04 50.31
diff.upright.irregular.highVSlow 57.46 -14.80 129.75 14.88
diff.inverted.angry.highVSlow -19.09 -64.26 18.85 4.41
diff.inverted.neutral.highVSlow 19.72 -21.72 67.06 4.17
diff.inverted.irregular.highVSlow -9.55 -81.61 61.61 1.63

Take-home message:

  • paired comparisons:
    • orientation
      • slower RTs for inverted compared to upright irregular faces when within-identity emotion variability is low
    • regularity
      • slightly slower RTs for angry compared to neutral inverted faces when within-identity emotion variability is low
      • slower RTs for irregular compared to neutral inverted faces when within-identity emotion variability is low
    • within-identity emotion variability
      • upright neutral: slower RTs for high compared to low within-identity emotion variability
      • upright irregular: slightly slower RTs for high compared to low within-identity emotion variability


Exp 1

  • flickering frequency: 6 Hz
  • regularity: 2 Hz
  • 2 face identities
  • task: detect dots on faces
Parameter Mean HDI95_Low HDI95_High Estimated_Sample_Size MonteCarlo_StdErr
10 upright_angry_low 518.3 478.8 558.4 12347 0.18
16 upright_neutral_low 512.2 471.4 553.0 12836 0.18
13 upright_irregular_low 483.6 443.5 523.3 12527 0.18
14 upright_irregular_low 483.6 443.5 523.3 12527 0.18
2 inverted_angry_low 488.6 448.5 528.7 12168 0.19
8 inverted_neutral_low 551.5 510.1 590.3 12425 0.18
5 inverted_irregular_low 538.8 495.8 580.8 12858 0.19
6 inverted_irregular_low 538.8 495.8 580.8 12858 0.19
9 upright_angry_high 504.5 462.3 544.6 13040 0.18
15 upright_neutral_high 511.2 473.9 551.4 12864 0.17
11 upright_irregular_high 562.3 519.7 602.4 12501 0.19
12 upright_irregular_high 562.3 519.7 602.4 12501 0.19
1 inverted_angry_high 525.4 485.1 567.9 12845 0.19
7 inverted_neutral_high 514.6 476.5 555.8 12908 0.18
3 inverted_irregular_high 551.6 508.6 591.5 12503 0.19
4 inverted_irregular_high 551.6 508.6 591.5 12503 0.19

exp1.posterior.test <- exp1.model %>%
  spread_draws(`b_.*`, regex = TRUE) %>%
  dplyr::select(
    "upright angry high" = "b_conditionupright_angry_high",
    "upright neutral high" = "b_conditionupright_neutral_high",
    "upright irregular high" = "b_conditionupright_irregular_high",
    "upright angry low" = "b_conditionupright_angry_low",
    "upright neutral low" = "b_conditionupright_neutral_low",
    "upright irregular low" = "b_conditionupright_irregular_low",
    "inverted angry high" = "b_conditioninverted_angry_high",
    "inverted neutral high" = "b_conditioninverted_neutral_high",
    "inverted irregular high" = "b_conditioninverted_irregular_high",
    "inverted angry low" = "b_conditioninverted_angry_low",
    "inverted neutral low" = "b_conditioninverted_neutral_low",
    "inverted irregular low" = "b_conditioninverted_irregular_low"
  ) %>%
  mutate(
    ### orientation
    # angry high
    diff.high.angry.uprightVSinverted = `upright angry high` - `inverted angry high`,
    # neutral high
    diff.high.neutral.uprightVSinverted = `upright neutral high` - `inverted neutral high`,
    # irregular high
    diff.high.irregular.uprightVSinverted = `upright irregular high` - `inverted irregular high`,
    # angry low
    diff.low.angry.uprightVSinverted = `upright angry low` - `inverted angry low`,
    # neutral high
    diff.low.neutral.uprightVSinverted = `upright neutral low` - `inverted neutral low`,
    # irregular high
    diff.low.irregular.uprightVSinverted = `upright irregular low` - `inverted irregular low`,
    ### regularity
    ## upright high
    # angry minus neutral
    diff.high.upright.angryVSneutral = `upright angry high` - `upright neutral high`,
    # angry minus irregular
    diff.high.upright.angryVSirregular = `upright angry high` - `upright irregular high`,
    # neutral minus irregular
    diff.high.upright.neutralVSirregular = `upright neutral high` - `upright irregular high`,
    ## upright low
    # angry minus neutral
    diff.low.upright.angryVSneutral = `upright angry low` - `upright neutral low`,
    # angry minus irregular
    diff.low.upright.angryVSirregular = `upright angry low` - `upright irregular low`,
    # neutral minus irregular
    diff.low.upright.neutralVSirregular = `upright neutral low` - `upright irregular low`,
    ## inverted high
    # angry minus neutral
    diff.high.inverted.angryVSneutral = `inverted angry high` - `inverted neutral high`,
    # angry minus irregular
    diff.high.inverted.angryVSirregular = `inverted angry high` - `inverted irregular high`,
    # neutral minus irregular
    diff.high.inverted.neutralVSirregular = `inverted neutral high` - `inverted irregular high`,
    ## inverted low
    # angry minus neutral
    diff.low.inverted.angryVSneutral = `inverted angry low` - `inverted neutral low`,
    # angry minus irregular
    diff.low.inverted.angryVSirregular = `inverted angry low` - `inverted irregular low`,
    # neutral minus irregular
    diff.low.inverted.neutralVSirregular = `inverted neutral low` - `inverted irregular low`,
    ### variability
    ## upright angry
    diff.upright.angry.highVSlow = `upright angry high` - `upright angry low`,
    ## upright neutral
    diff.upright.neutral.highVSlow = `upright neutral high` - `upright neutral low`,
    ## upright irregular
    diff.upright.irregular.highVSlow = `upright irregular high` - `upright irregular low`,
    ## inverted angry
    diff.inverted.angry.highVSlow = `inverted angry high` - `inverted angry low`,
    ## inverted neutral
    diff.inverted.neutral.highVSlow = `inverted neutral high` - `inverted neutral low`,
    ## inverted irregular
    diff.inverted.irregular.highVSlow = `inverted irregular high` - `inverted irregular low`
  ) %>%
  gather(key = "condition", value = "RTs") %>%
  filter(condition == c(
    "diff.high.angry.uprightVSinverted",
    "diff.high.neutral.uprightVSinverted",
    "diff.high.irregular.uprightVSinverted",
    "diff.low.angry.uprightVSinverted",
    "diff.low.neutral.uprightVSinverted",
    "diff.low.irregular.uprightVSinverted",
    "diff.high.upright.angryVSneutral",
    "diff.high.upright.angryVSirregular",
    "diff.high.upright.neutralVSirregular",
    "diff.low.upright.angryVSneutral",
    "diff.low.upright.angryVSirregular",
    "diff.low.upright.neutralVSirregular",
    "diff.high.inverted.angryVSneutral",
    "diff.high.inverted.angryVSirregular",
    "diff.high.inverted.neutralVSirregular",
    "diff.low.inverted.angryVSneutral",
    "diff.low.inverted.angryVSirregular",
    "diff.low.inverted.neutralVSirregular",
    "diff.upright.angry.highVSlow",
    "diff.upright.neutral.highVSlow",
    "diff.upright.irregular.highVSlow",
    "diff.inverted.angry.highVSlow",
    "diff.inverted.neutral.highVSlow",
    "diff.inverted.irregular.highVSlow"
  )) %>%
  droplevels() %>%
  mutate(condition = factor(condition,
    levels = c(
      "diff.high.angry.uprightVSinverted",
      "diff.high.neutral.uprightVSinverted",
      "diff.high.irregular.uprightVSinverted",
      "diff.low.angry.uprightVSinverted",
      "diff.low.neutral.uprightVSinverted",
      "diff.low.irregular.uprightVSinverted",
      "diff.high.upright.angryVSneutral",
      "diff.high.upright.angryVSirregular",
      "diff.high.upright.neutralVSirregular",
      "diff.low.upright.angryVSneutral",
      "diff.low.upright.angryVSirregular",
      "diff.low.upright.neutralVSirregular",
      "diff.high.inverted.angryVSneutral",
      "diff.high.inverted.angryVSirregular",
      "diff.high.inverted.neutralVSirregular",
      "diff.low.inverted.angryVSneutral",
      "diff.low.inverted.angryVSirregular",
      "diff.low.inverted.neutralVSirregular",
      "diff.upright.angry.highVSlow",
      "diff.upright.neutral.highVSlow",
      "diff.upright.irregular.highVSlow",
      "diff.inverted.angry.highVSlow",
      "diff.inverted.neutral.highVSlow",
      "diff.inverted.irregular.highVSlow"
    )
  ))

# summary
summary.exp1.posterior.test <- exp1.posterior.test %>%
  group_by(condition) %>%
  dplyr::summarize(
    mean = mean(RTs),
    hdi.95.low = hdi(RTs)[1],
    hdi.95.high = hdi(RTs)[2],
    evidence.ratio = ifelse(mean < 0, 
                            length(which(RTs < 0)) / length(which(RTs > 0)),
                            length(which(RTs > 0)) / length(which(RTs < 0))
    )
  ) %>%
  ungroup()

kable(summary.exp1.posterior.test, digits = 2)
condition mean hdi.95.low hdi.95.high evidence.ratio
diff.high.angry.uprightVSinverted -21.36 -80.45 40.29 3.30
diff.high.neutral.uprightVSinverted -2.83 -61.94 54.26 1.11
diff.high.irregular.uprightVSinverted 11.26 -44.92 67.51 1.90
diff.low.angry.uprightVSinverted 28.80 -23.00 86.58 4.85
diff.low.neutral.uprightVSinverted -39.60 -94.69 18.74 10.31
diff.low.irregular.uprightVSinverted -55.50 -111.17 7.23 25.64
diff.high.upright.angryVSneutral -5.05 -57.45 46.57 1.38
diff.high.upright.angryVSirregular -58.29 -114.48 -7.75 65.70
diff.high.upright.neutralVSirregular -50.36 -104.63 4.11 30.76
diff.low.upright.angryVSneutral 5.51 -54.08 57.62 1.41
diff.low.upright.angryVSirregular 36.40 -13.24 95.86 9.25
diff.low.upright.neutralVSirregular 27.69 -33.34 76.91 4.65
diff.high.inverted.angryVSneutral 9.66 -52.89 64.12 1.76
diff.high.inverted.angryVSirregular -26.21 -92.34 28.23 3.69
diff.high.inverted.neutralVSirregular -37.44 -93.08 19.43 8.67
diff.low.inverted.angryVSneutral -62.82 -119.87 -7.30 82.38
diff.low.inverted.angryVSirregular -50.13 -109.73 2.73 22.82
diff.low.inverted.neutralVSirregular 10.48 -51.57 65.02 1.78
diff.upright.angry.highVSlow -14.61 -78.51 38.20 2.13
diff.upright.neutral.highVSlow -1.05 -56.25 59.14 0.96
diff.upright.irregular.highVSlow 79.98 23.94 140.32 332.50
diff.inverted.angry.highVSlow 38.25 -25.66 89.45 11.81
diff.inverted.neutral.highVSlow -36.27 -89.68 15.85 9.93
diff.inverted.irregular.highVSlow 11.19 -42.50 70.65 1.85

Take-home message:

  • paired comparisons:
    • orientation
      • slightly slower RTs for inverted compared to upright neutral faces when within-identity emotion variability is low
      • slightly slower RTs for inverted compared to upright irregular faces when within-identity emotion variability is low
    • regularity
      • slower RTs for irregular compared to angry upright faces when within-identity emotion variability is high
      • slightly slower RTs for irregular compared to neutral upright faces when within-identity emotion variability is high
      • slower RTs for neutral compared to angry inverted faces when within-identity emotion variability is low
      • slightly slower RTs for irregular compared to angry inverted faces when within-identity emotion variability is low
    • within-identity emotion variability
      • upright irregular: slower RTs for high compared to low within-identity emotion variability
      • inverted angry: slightly slower RTs for high compared to low within-identity emotion variability